home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3 / il / ilBuffer.z / ilBuffer
Encoding:
Text File  |  2002-10-03  |  8.0 KB  |  199 lines

  1.  
  2.  
  3.  
  4. iiiillllBBBBuuuuffffffffeeeerrrr((((3333))))        IIIImmmmaaaaggggeeeeVVVViiiissssiiiioooonnnn LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll        iiiillllBBBBuuuuffffffffeeeerrrr((((3333))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      iiiillllBBBBuuuuffffffffeeeerrrr - Provides 4-D resizeable buffer support
  10.  
  11. IIIINNNNHHHHEEEERRRRIIIITTTTSSSS FFFFRRRROOOOMMMM
  12.      This is a base class.
  13.  
  14. HHHHEEEEAAAADDDDEEEERRRR FFFFIIIILLLLEEEE
  15.      #include <il/ilBuffer.h>
  16.  
  17. CCCCLLLLAAAASSSSSSSS DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  18.      ilBuffer provides support for accessing a buffer in up to four
  19.      dimensions. The call operator, (), is overloaded to operate on an
  20.      ilBuffer object and returns a pointer to the specified element in the
  21.      buffer.
  22.  
  23.      In addition, the buffer can be resized after being created. If the new
  24.      size is smaller and the difference is less than a specified size, the
  25.      original buffer is reused to avoid a malloc. If the new size is smaller
  26.      but the difference is greater than a specified size, or if the new size
  27.      is larger, then the old buffer is de-allocated and a new buffer is
  28.      allocated.
  29.  
  30.      ilBuffer also provides three public member variables that can be
  31.      accessed.
  32.  
  33.           iiiinnnntttt _d_e_l     Number of bytes to trigger re-allocation
  34.  
  35.           iiiinnnntttt _s_i_z_e    Total size of current buffer in bytes
  36.  
  37.           vvvvooooiiiidddd**** _d_a_t_a  Currently allocated data pointer
  38.  
  39.  
  40. CCCCLLLLAAAASSSSSSSS MMMMEEEEMMMMBBBBEEEERRRR FFFFUUUUNNNNCCCCTTTTIIIIOOOONNNN SSSSUUUUMMMMMMMMAAAARRRRYYYY
  41.      CCCCoooonnnnssssttttrrrruuuuccccttttoooorrrrssss
  42.  
  43.           ilBuffer()
  44.           ilBuffer(int sz, int d = defaultDel)
  45.           ilBuffer(iflDataType dataType, int n0, int n1=1, int n2=1, int n3=1)
  46.           ilBuffer(void* buffer, iflDataType dataType, int n0, int n1=1,
  47.                    int n2=1, int n3=1)
  48.  
  49.      MMMMeeeetttthhhhooooddddssss ttttoooo rrrreeeessssiiiizzzzeeee bbbbuuuuffffffffeeeerrrr
  50.  
  51.           void* resize(int sz)
  52.           void* resize(int n0, int n1, int n2=1, int n3=1)
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. iiiillllBBBBuuuuffffffffeeeerrrr((((3333))))        IIIImmmmaaaaggggeeeeVVVViiiissssiiiioooonnnn LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll        iiiillllBBBBuuuuffffffffeeeerrrr((((3333))))
  71.  
  72.  
  73.  
  74.      QQQQuuuueeeerrrryyyyiiiinnnngggg aaaabbbboooouuuutttt bbbbuuuuffffffffeeeerrrr pppprrrrooooppppeeeerrrrttttiiiieeeessss
  75.  
  76.           iflDataType getDataType()
  77.           int getDimension(int dim)
  78.  
  79.      GGGGeeeettttttttiiiinnnngggg ppppooooiiiinnnntttteeeerrrr ttttoooo aaaannnn eeeelllleeeemmmmeeeennnntttt
  80.  
  81.           void* operator()(int idx0)
  82.           void* operator()(int idx0, int idx1)
  83.           void* operator()(int idx0, int idx1, int idx2)
  84.           void* operator()(int idx0, int idx1, int idx2, int idx3)
  85.  
  86.  
  87. FFFFUUUUNNNNCCCCTTTTIIIIOOOONNNN DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNNSSSS
  88.      ggggeeeettttDDDDaaaattttaaaaTTTTyyyyppppeeee(((())))
  89.  
  90.           iflDataType getDataType()
  91.  
  92.  
  93.           This function returns the IL data type of the elements in the
  94.           buffer. The enumerated type, _i_f_l_D_a_t_a_T_y_p_e, can be one of the
  95.           following:  _i_l_B_i_t, _i_l_U_C_h_a_r, _i_l_C_h_a_r, _i_l_U_S_h_o_r_t, _i_l_S_h_o_r_t, _i_l_U_L_o_n_g,
  96.           _i_l_L_o_n_g, _i_l_F_l_o_a_t or _i_l_D_o_u_b_l_e.
  97.  
  98.      ggggeeeettttDDDDiiiimmmmeeeennnnssssiiiioooonnnn(((())))
  99.  
  100.           int getDimension(int dim)
  101.  
  102.  
  103.           This function returns the number of elements in the dimension
  104.           specified. The valid range for _d_i_m is 0-3.
  105.  
  106.      iiiillllBBBBuuuuffffffffeeeerrrr(((())))
  107.  
  108.           ilBuffer()
  109.           ilBuffer(int sz, int d = defaultDel)
  110.           ilBuffer(iflDataType dataType, int n0, int n1=1, int n2=1, int n3=1)
  111.           ilBuffer(void* buffer, iflDataType dataType,
  112.                 int n0, int n1=1, int n2=1, int n3=1)
  113.  
  114.  
  115.           Several versions of the constuctor are provided through overloading.
  116.           The first (default) version takes no parameters and causes the
  117.           buffer to be initialized to the default size of 16384 (128x128x1)
  118.           bytes. The second version allows the size to be set to _s_z bytes. In
  119.           addition, the resize threshold is set to _d bytes. When the buffer is
  120.           resized smaller and the difference between the original size and the
  121.           new size is greater than _d bytes, the old buffer is de-allocated and
  122.           a new buffer is allocated.
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. iiiillllBBBBuuuuffffffffeeeerrrr((((3333))))        IIIImmmmaaaaggggeeeeVVVViiiissssiiiioooonnnn LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll        iiiillllBBBBuuuuffffffffeeeerrrr((((3333))))
  137.  
  138.  
  139.  
  140.           The third version allows the buffer size to be specified by giving
  141.           the IL data type and a maximum of four dimensions. Note that the
  142.           last three dimensions default to 1 for conveniently specifying a 1-
  143.           D, 2-D or 3-D buffer. The last version of the constructor allows a
  144.           user to provide a buffer and specify its IL data type and
  145.           dimensions. In this case, ilBuffer does not allocate a buffer but
  146.           simply uses the buffer provided.
  147.  
  148.      ooooppppeeeerrrraaaattttoooorrrr(((())))
  149.  
  150.           void* operator()(int idx0)
  151.           void* operator()(int idx0, int idx1)
  152.           void* operator()(int idx0, int idx1, int idx2)
  153.           void* operator()(int idx0, int idx1, int idx2, int idx3)
  154.  
  155.  
  156.           The call operator, (((()))), is overloaded to operate on an ilBuffer
  157.           object. In addition, the call operator is further overloaded to
  158.           provide 1-D, 2-D, 3-D or 4-D access to the buffer.  In each case, a
  159.           pointer is returned to the specified element in the buffer.
  160.  
  161.      rrrreeeessssiiiizzzzeeee(((())))
  162.  
  163.           void* resize(int sz)
  164.           void* resize(int n0, int n1, int n2=1, int n3=1)
  165.  
  166.  
  167.           This function allows the buffer to be resized. Two versions are
  168.           provided through overloading. The first version allows the buffer
  169.           size to be specified in bytes. The second version allows the buffer
  170.           size to be specified by its dimensions.
  171.  
  172. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  173.      _i_l/_i_l_D_a_t_a_S_i_z_e._h, _i_l/_i_l_T_y_p_e_s._h, _i_f_l/_i_f_l_T_y_p_e_s._h
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.